$(document).ready(function(){
    
    control_nav();
    
    
    $('.nav>li').click(function(){
        
        //removes all active and add active to the instance of li only
        var instance = $(this);
        toggle_active(instance);
        
        control_nav();
            
        
        
    });

});

function control_nav(){
    home_info();
    bella_info();
    jazz_info();
    puppies_info();
    contacts_info();
        
};

function toggle_active(instance){
    $('.nav>li').removeClass("active");
    instance.addClass("active");    
};

//function clear_text_info(){
//    
//    //clear all texts so the fadeIn on active only
//    $('.info').fadeOut(1222);
//    
//};

//Bella_info
//Jazz_info
//Puppies_info
//functions


function home_info(){
    if($('#page_home').hasClass("active")){
        $('#home_info').fadeIn("slow");
        console.log( "in home_info() and in 'hasActive");
    }else{
        $('#home_info').fadeOut(100);
    };
};
function bella_info(){
    if($('#page_bella').hasClass("active")){
        $('#bella_info').fadeIn("slow");
        console.log( "in bella_info() and in 'hasActive");
    }else{
        $('#bella_info').fadeOut(100);
    };
};
function jazz_info(){
    if($('#page_jazz').hasClass("active")){
        $('#jazz_info').fadeIn("slow");
    }else{
       $('#jazz_info').fadeOut("fast"); 
    };
};
function puppies_info(){
    if($('#page_puppies').hasClass("active")){
        $('#puppies_info').fadeIn("slow");
    }else{
        $('#puppies_info').fadeOut(100);
    };
};
function contacts_info(){
    if($('#page_contacts').hasClass("active")){
        $('#contacts_info').fadeIn("slow");
    }else{
        $('#contacts_info').fadeOut("100");
    };
};

